package com.hzhr.iot.device.service;

import com.hzhr.iot.core.annotation.ApiImplicitInternalParams;
import com.hzhr.iot.core.constant.AccessModeEnum;
import com.hzhr.iot.core.exception.ServiceException;
import com.hzhr.iot.core.util.HzhrJsonUtil;
import com.hzhr.iot.device.constant.DeviceOptions;
import com.hzhr.iot.device.constant.Device_ErrorsEnum;
import com.hzhr.iot.device.convertor.custom.CollectDeviceCustomConvertor;
import com.hzhr.iot.device.dao.CollectDeviceDao;
import com.hzhr.iot.device.dao.IotDeviceDao;
import com.hzhr.iot.device.model.bkMeter.*;
import com.hzhr.iot.device.model.collectDevice.CollectDeviceModel;
import com.hzhr.iot.device.model.collectDevice.CollectDevicePostModel;
import com.hzhr.iot.device.model.collectDevice.CollectDevicePutModel;
import com.hzhr.iot.device.model.iotDevice.IotDeviceModel;
import com.hzhr.iot.device.model.iotDevice.IotDevicePostModel;
import com.hzhr.iot.device.service.base.BaseService;
import com.hzhr.iot.device.service.helper.*;
import com.hzhr.iot.toll.sdk.model.gasUser.GasUserModel;
import com.hzhr.iot.toll.sdk.service.Toll_GasUserService;
import com.hzhr.iot.user.sdk.service.User_CompanyService;
import com.hzhr.iot.user.sdk.service.User_DeptService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.HashMap;
import java.util.Map;

@Service
public class BkMeterService extends BaseService {
    @Autowired
    CollectDeviceCustomConvertor collectDeviceCustomConvertor;
    @Autowired
    CollectDeviceDao collectDeviceDao;
    @Autowired
    CollectDeviceService collectDeviceService;
    @Autowired
    User_DeptService user_deptService;
    @Autowired
    Toll_GasUserService toll_gasUserService;
    @Autowired
    IotDeviceService iotDeviceService;
    @Autowired
    User_CompanyService user_companyService;
    @Autowired
    CollectDataService collectDataService;
    @Autowired
    IotDeviceDao iotDeviceDao;
    @Autowired
    DeviceOptions deviceOptions;
    @Autowired
    IotDeviceTypeServiceHelper iotDeviceTypeServiceHelper;
    @Autowired
    IotDeviceServiceHelper iotDeviceServiceHelper;
    @Autowired
    CollectDeviceServiceHelper collectDeviceServiceHelper;
    @Autowired
    User_DeptServiceHelper user_deptServiceHelper;
    @Autowired
    Toll_GasUserServiceHelper toll_gasUserServiceHelper;

    //region javadoc注释 : post
    /**
     * 实施档案-创建bk表台账 <br/><br/>
     * 范围 : 无 <br/>
     * 步骤 : <br/>
     * 1. 以系统用户身份：查询燃气用户，如果燃气用户不存在，抛出异常; (√) <br/>
     * 2. 以系统用户身份：如果dtu物联台账不存在，则创建dtu的物联台账; (√) <br/>
     * 3. 以系统用户身份：创建bk表采集台账，并关联刚才创建的dtu和燃气用户; (√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see BkMeterPostModel body <br/>
     * @see BkMeterPostResponseModel result <br/>
     */ 
    //endregion
    //region 说明 : post
    //实施档案-创建bk表台账
    //范围 : 无
    //步骤 :
    //1. 以系统用户身份：查询燃气用户，如果燃气用户不存在，抛出异常; (√)
    //2. 以系统用户身份：如果dtu物联台账不存在，则创建dtu的物联台账; (√)
    //3. 以系统用户身份：创建bk表采集台账，并关联刚才创建的dtu和燃气用户; (√)
    //endregion
    //region 参数 : post
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),
    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : post
    @RequestMapping(value = "/bk-meters", method = RequestMethod.POST)
    //endregion
    public BkMeterPostResponseModel post(Map<String, String> header, Map<String, Object> query,
                                                    BkMeterPostModel body) throws ServiceException {
        //以系统用户身份：查询燃气用户，如果燃气用户不存在，抛出异常
        String gasUserCode = body.getGasUserCode();
        Map<String, Object> getGasUserQuery = new HashMap<>();
        getGasUserQuery.put("_equal_companyId", body.getGasCompanyId());
        getGasUserQuery.put("_equal_code", gasUserCode);
        getGasUserQuery.put("_show", "one");
        getGasUserQuery.put("_show_info", true);
        GasUserModel gasUser = toll_gasUserService.get(initHeader(header, AccessModeEnum.GLOBAL), getGasUserQuery).getModel();
        if (gasUser == null) {
            throw new ServiceException(Device_ErrorsEnum.COLLECTDEVICESERVICE_IMPL_ADD_BK_METER_201);
        }

        //以系统用户身份：如果dtu物联台账不存在，则创建dtu的物联台账
        IotDevicePostModel iotDevicePostModel = new IotDevicePostModel();
        iotDevicePostModel.setCode(body.getDtuCode());
        iotDevicePostModel.setTypeId(body.getDtuTypeId());
        iotDevicePostModel.setDeptId(body.getDeptId());
        iotDevicePostModel.setCompanyId(body.getIotCompanyId());
        iotDevicePostModel.setGasCompanyId(body.getGasCompanyId());
        iotDevicePostModel.setCategoryCode(deviceOptions.getCode("IOT_DEVICE_CATEGORY", "DTU"));
        iotDevicePostModel.setIotPlatformDeviceId(body.getDtuCode());
        iotDevicePostModel.setIotPlatformCode(deviceOptions.getCode("IOT_PLATFORM_TYPE", "SELF_BUILD"));
        Map<String, Object> postIotDeviceQuery = new HashMap<>();
        postIotDeviceQuery.put("_show", "one");
        postIotDeviceQuery.put("_show_info", true);
        //IotDeviceModel iotDevice = iotDeviceService.post(initHeader(header, AccessModeEnum.GLOBAL), postIotDeviceQuery, iotDevicePostModel).getModel();

        //以系统用户身份：创建bk表采集台账，并关联刚才创建的dtu和燃气用户
        CollectDevicePostModel collectDevicePostModel = new CollectDevicePostModel();
        collectDevicePostModel.setCode(body.getBkMeterCode());
        collectDevicePostModel.setCategoryCode(deviceOptions.getCode("COLLECT_DEVICE_CATEGORY", "BK_METER"));
        collectDevicePostModel.setTypeId(body.getBkMeterTypeId());
        collectDevicePostModel.setCompanyId(body.getGasCompanyId());
        collectDevicePostModel.setDeptId(body.getDeptId());
        collectDevicePostModel.setGasUserId(gasUser.getId());
        collectDevicePostModel.setGasUserCode(gasUser.getCode());
        collectDevicePostModel.setGasUserName(gasUser.getName());
        collectDevicePostModel.setGasUserAddress(gasUser.getAddress());
        //collectDevicePostModel.setIotDeviceId(iotDevice.getId());
        Map<String, Object> postCollectDeviceQuery = new HashMap<>();
        //collectDeviceService.post(initHeader(header, AccessModeEnum.GLOBAL), postCollectDeviceQuery, collectDevicePostModel);

        String transactionId = getTransactionId(header);
        BkMeterPostResponseModel response = new BkMeterPostResponseModel();
        response.setTransactionId(transactionId);
        return response;
    }

    //region javadoc注释 : put
    /**
     * 实施档案-修改bk表台账 <br/><br/>
     * 范围 : 无 <br/>
     * 步骤 : <br/>
     * 1. 以系统用户身份：查询bk表信息，如果bk表不存在则报错; (√) <br/>
     * 2. 以系统用户身份：修改bk表采集台账，如果修改了DTU号或用户号，须查询新的DTU或用户是否存在，如果不存在则报错，否则须关联新的DTU或用户号; (√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see BkMeterPutModel body <br/>
     * @see BkMeterPutResponseModel result <br/>
     */ 
    //endregion
    //region 说明 : put
    //实施档案-修改bk表台账
    //范围 : 无
    //步骤 :
    //1. 以系统用户身份：查询bk表信息，如果bk表不存在则报错; (√)
    //2. 以系统用户身份：修改bk表采集台账，如果修改了DTU号或用户号，须查询新的DTU或用户是否存在，如果不存在则报错，否则须关联新的DTU或用户号; (√)
    //endregion
    //region 参数 : put
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),
    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : put
    @RequestMapping(value = "/bk-meters", method = RequestMethod.PUT)
    //endregion
    public BkMeterPutResponseModel put(Map<String, String> header, Map<String, Object> query,
                                                   BkMeterPutModel body) throws ServiceException {
        //以系统用户身份：查询bk表信息，如果bk表不存在则报错
        CollectDeviceModel oriBkMeter = collectDeviceServiceHelper.getByIdShowIotDeviceAndGasUser(initHeader(header, AccessModeEnum.GLOBAL), body.getBkMeterId());
        if (oriBkMeter == null) {
            throw new ServiceException(Device_ErrorsEnum.COLLECTDEVICESERVICE_IMPL_SET_BK_METER_201);
        }

        //以系统用户身份：修改bk表采集台账，如果修改了DTU号或用户号，须查询新的DTU或用户是否存在，如果不存在则报错，否则须关联新的DTU或用户号
        CollectDevicePutModel putModel = HzhrJsonUtil.convertObjectType(oriBkMeter, CollectDevicePutModel.class);

        String gasUserCode = body.getGasUserCode();
        String dtuCode = body.getDtuCode();
        Integer gasCompanyId = body.getGasCompanyId();

        String oriGasUserCode = oriBkMeter.getGasUserCode();
        if (!oriGasUserCode.equals(gasUserCode)) {
            GasUserModel gasUser = toll_gasUserServiceHelper.getByCodeAndCompanyId(initHeader(header, AccessModeEnum.GLOBAL), gasUserCode, gasCompanyId);
            if (gasUser == null) {
                throw new ServiceException(Device_ErrorsEnum.COLLECTDEVICESERVICE_IMPL_SET_BK_METER_202);
            } else {
                putModel.setGasUserId(gasUser.getId());
                putModel.setGasUserCode(gasUser.getCode());
                putModel.setGasUserName(gasUser.getName());
                putModel.setGasUserAddress(gasUser.getAddress());
            }
        }

        String oriDtuCode = oriBkMeter.getIotDeviceCode();
        if (!oriDtuCode.equals(dtuCode)) {
            IotDeviceModel dtu = iotDeviceServiceHelper.getByCode(initHeader(header, AccessModeEnum.GLOBAL), dtuCode);
            if (dtu == null) {
                throw new ServiceException(Device_ErrorsEnum.COLLECTDEVICESERVICE_IMPL_SET_BK_METER_203);
            } else {
                putModel.setIotDeviceId(dtu.getId());
            }
        }

        putModel.setCode(body.getBkMeterCode());
        putModel.setTypeId(body.getBkMeterTypeId());
        putModel.setCompanyId(body.getGasCompanyId());
        putModel.setDeptId(body.getDeptId());
        Map<String, Object> query1 = new HashMap<>();
        //collectDeviceService.putById(initHeader(header, AccessModeEnum.GLOBAL), body.getBkMeterId(), query1, putModel);

        String transactionId = getTransactionId(header);
        BkMeterPutResponseModel response = new BkMeterPutResponseModel();
        response.setTransactionId(transactionId);
        return response;
    }

    //region javadoc注释 : delete
    /**
     * 实施档案-删除bk表台账 <br/><br/>
     * 范围 : 无 <br/>
     * 步骤 : <br/>
     * 1. 以系统用户身份：删除该bk表的采集台账信息; (√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see BkMeterDeleteModel body <br/>
     * @see BkMeterDeleteResponseModel result <br/>
     */ 
    //endregion
    //region 说明 : delete
    //实施档案-删除bk表台账
    //范围 : 无
    //步骤 :
    //1. 以系统用户身份：删除该bk表的采集台账信息; (√)
    //endregion
    //region 参数 : delete
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),
    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : delete
    @RequestMapping(value = "/bk-meters", method = RequestMethod.DELETE)
    //endregion
    public BkMeterDeleteResponseModel delete(Map<String, String> header, Map<String, Object> query,
                                                      BkMeterDeleteModel body) throws ServiceException {
        //以系统用户身份：删除该压力检测仪的采集台账信息
        Integer pressureMeterId = body.getBkMeterId();
        //collectDeviceService.deleteById(initHeader(header, AccessModeEnum.GLOBAL), pressureMeterId, new HashMap<>());

        //返回
        String transactionId = getTransactionId(header);
        BkMeterDeleteResponseModel response = new BkMeterDeleteResponseModel();
        response.setTransactionId(transactionId);
        return response;
    }
}

